package com.inspur.gs.scm.sd.salesorder.rest;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.inspur.edp.sgf.api.service.ServiceInvoker;
import lombok.Data;

import java.util.ArrayList;
import java.util.Objects;

@Data
public class ZUserVoExtend1ServiceImpl implements ZUserVoExtend1Service {

    protected String voId = "8ac64c96-5c03-45ff-bd0b-0fa2aefa9f90";

    protected String voCode = "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1";

    @Override
    public String createSession() {
        return "createSession";
    }

    @Override
    public Object create(JsonNode node) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(Objects.isNull(node) ? null : node.get("requestInfo"));
            jsonNodes.add(Objects.isNull(node) ? null : node.get("defaultValue"));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&Create", jsonNodes);
    }

    @Override
    public Object edit(String dataId, JsonNode node) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(node);
            jsonNodes.add(mapper.valueToTree(dataId));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&Edit", jsonNodes);
    }

    @Override
    public void delete() {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&Delete", jsonNodes);
    }

    @Override
    public void batchDelete(String ids) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(mapper.valueToTree(ids));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&BatchDelete", jsonNodes);
    }

    @Override
    public Object update(JsonNode node) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(Objects.isNull(node) ? null : node.get("requestInfo"));
            jsonNodes.add(Objects.isNull(node) ? null : node.get("changeDetail"));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&Update", jsonNodes);
    }

    @Override
    public Object retrieve(String dataId) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(mapper.valueToTree(dataId));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&Retrieve", jsonNodes);
    }

    @Override
    public Object retrieveWithChildPagination(String dataId, JsonNode node) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(Objects.isNull(node) ? null : node.get("requestInfo"));
            jsonNodes.add(mapper.valueToTree(dataId));
            jsonNodes.add(Objects.isNull(node) ? null : node.get("retrieveParam"));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&RetrieveWithChildPagination", jsonNodes);
    }

    @Override
    public Object queryChild(JsonNode node) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(Objects.isNull(node) ? null : node.get("requestInfo"));
            jsonNodes.add(Objects.isNull(node) ? null : node.get("nodeCodes"));
            jsonNodes.add(Objects.isNull(node) ? null : node.get("ids"));
            jsonNodes.add(Objects.isNull(node) ? null : node.get("pagination"));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&QueryChild", jsonNodes);
    }

    @Override
    public Object query(String entityFilter) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(mapper.valueToTree(entityFilter));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&Query", jsonNodes);
    }

    @Override
    public Object save(JsonNode node) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(node);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&保存", jsonNodes);
    }

    @Override
    public void cancel() {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&Cancel", jsonNodes);
    }

    @Override
    public Object getElementHelp(String labelId, String nodeCode, String queryParam) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(mapper.valueToTree(labelId));
            jsonNodes.add(mapper.valueToTree(nodeCode));
            jsonNodes.add(mapper.valueToTree(queryParam));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&ElementHelp", jsonNodes);
    }

    @Override
    public Object createChildUserDetail(String rootId, JsonNode node) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(node);
            jsonNodes.add(mapper.valueToTree(rootId));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&CreateChild##UserDetail", jsonNodes);
    }

    @Override
    public void deleteChildUserDetail(String rootId, String userDetailId) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(mapper.valueToTree(rootId));
            jsonNodes.add(mapper.valueToTree(userDetailId));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&DeleteChild##UserDetail", jsonNodes);
    }

    @Override
    public Object extend_Delete(JsonNode node) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(Objects.isNull(node) ? null : node.get("requestInfo"));
            jsonNodes.add(Objects.isNull(node) ? null : node.get("dataId"));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&Extend_Delete", jsonNodes);
    }

    @Override
    public Object extend_BatchDelete(String ids, JsonNode node) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(node);
            jsonNodes.add(mapper.valueToTree(ids));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&Extend_BatchDelete", jsonNodes);
    }

    @Override
    public Object extend_Retrieve(String dataId, JsonNode node) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(node);
            jsonNodes.add(mapper.valueToTree(dataId));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&Extend_Retrieve", jsonNodes);
    }

    @Override
    public Object extend_Query(String entityFilter, JsonNode node) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(node);
            jsonNodes.add(mapper.valueToTree(entityFilter));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&Extend_Query", jsonNodes);
    }

    @Override
    public Object extend_GetElementHelp(JsonNode node) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(Objects.isNull(node) ? null : node.get("requestInfo"));
            jsonNodes.add(Objects.isNull(node) ? null : node.get("labelId"));
            jsonNodes.add(Objects.isNull(node) ? null : node.get("nodeCode"));
            jsonNodes.add(Objects.isNull(node) ? null : node.get("queryParam"));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&Extend_ElementHelp", jsonNodes);
    }

    @Override
    public Object extend_DeleteChildUserDetail(String rootId, String userDetailId, JsonNode node) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(node);
            jsonNodes.add(mapper.valueToTree(rootId));
            jsonNodes.add(mapper.valueToTree(userDetailId));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "c1a294b7-9407-4c6a-bc9c-c56f14210e08&^^&Extend_DeleteChild##UserDetail", jsonNodes);
    }

    @Override
    public Object dataDeser(JsonNode node) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(node);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "b8385dd6-f1b7-4e5d-84a6-18a6ceb78396&^^&DataDeser", jsonNodes);
    }

    @Override
    public Object submit(JsonNode node) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(node);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "48c6a5ad-7f9b-405e-a623-627254c9bb64&^^&Submit", jsonNodes);
    }

    @Override
    public Object t1(JsonNode node) {
        ArrayList<JsonNode> jsonNodes = new ArrayList<JsonNode>();
        ObjectMapper mapper = new ObjectMapper();
        try {
            jsonNodes.add(node);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return ServiceInvoker.invokeByJsonNode("VO", "com.inspur.gs.scm.sd.salesorder.vo.ZUserVoExtend1", "358cb06d-7be8-40cb-bc3c-957d4c9359a2&^^&T1", jsonNodes);
    }

}